﻿using UtfprLibrary.Windows.Forms;
using System.Linq;
using System.Windows.Forms;
using WinFormApp_Sample.Data;

namespace WinFormApp_Sample.WinForm {
    public sealed partial class FormFooCrud : UtfprFormCrudBase {
        public FormFooCrud() {
            InitializeComponent();
        }

        private void button1_Click(object sender, System.EventArgs e) {
            var ve = utfprGroupBox1.ToString();
            var v = utfprLookupField1.ToString();

            ubnRequiredFieldsValidator1.Validate();   
        }

        private void button2_Click(object sender, System.EventArgs e) {
            utfprGroupBox1.Enabled = true;
            utfprRadioButton1.Enabled = true;
            utfprRadioButton2.Enabled = true;
            utfprCheckBox1.Enabled = true;
            utfprCheckBox2.Enabled = true;
            utfprLookupField1.Enabled = true;
            dateTimePicker1.Enabled = true;
            comboBox1.Enabled = true;
        }

        private void button3_Click(object sender, System.EventArgs e) {
            dateTimePicker1.CustomFormat = "";
            dateTimePicker1.Format = DateTimePickerFormat.Long;
        }

        private void button4_Click(object sender, System.EventArgs e) {
            estadoBindingSource.Add(Estado.CreateEstado(99, "Teste", "TT"));
        }

        private void button5_Click(object sender, System.EventArgs e) {
            utfprRadioButton1.Checked = false;
        }
    }
}